import React from "react";
// 1. 什么是路由 ？
// 2. 为什么路由 ？
import { RouterProvider, createBrowserRouter, Navigate } from "react-router-dom";
import Home from "./views/home";
import Car from "./views/car";
import User from "./views/user";
const App1 = () => {
  const router = createBrowserRouter([
    {
      path: '/',
      // 重定向
      element: <Navigate to="/home"></Navigate>
    },
    {
      path: "/home",
      element: <Home></Home>,
    },
    {
      path: "/user",
      element: <User></User>,
    },
    {
      path: "/car",
      element: <Car></Car>,
    },
  ]);
  return <RouterProvider router={router}></RouterProvider>;
};

export default App1;
